package com.itheima.controller;

import com.itheima.common.PageBean;
import com.itheima.common.R;
import com.itheima.dto.CheckitemDto;
import com.itheima.dto.CustomerDto;
import com.itheima.service.CustomerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin (value = "*", methods = {RequestMethod.GET, RequestMethod.POST, RequestMethod.PUT, RequestMethod.DELETE})
@RestController
@RequestMapping ("/customer")
@Slf4j
public class CustomerController {
    @Autowired
    private CustomerService customerService;

    /**
     * 检查项分页条件查询
     *
     * @param customerDto 条件
     * @return R
     */
    @GetMapping ("/pageQuery")
    public R pageQuery(CustomerDto customerDto) {
        PageBean pageBean = customerService.pageQuery(customerDto);
        return R.ok(pageBean);
    }
}
